﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Web.Admin.Page_Channel
{
    public partial class Edit : Evan.WebUI.DetailManager
    {
        //protected string TemplateJson = "{}";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //TemplateJson = Evan.Common.DirFile.ReadFile("~/App_Data/Template.json");
            }
        }
        
        /// <summary>
        /// 检查 复制出来的栏目WebPath是否未修改过 
        /// </summary>
        /// <param name="thisChannel">栏目的model</param>
        /// <returns></returns>
        public bool CheckCopyWebPath(dynamic thisChannel)
        {
            if (thisChannel==null)
            {
                return false;
            }
            //规则 Copy_id/
            if (string.IsNullOrEmpty(thisChannel.WebPath))
            {
                return false;
            }
            //if (thisChannel.WebPath.EndsWith(string.Format(thisChannel.WebPath.TrimEnd('/') + "{0}/", thisChannel.Id), StringComparison.OrdinalIgnoreCase))
            if (thisChannel.WebPath.EndsWith(thisChannel.Id + "/"))
            {
                //是复制还未修改WebPath 
                return true;
            }
            else
            {
                //已经修改过
                return false;
            }
        }

    }
}